package tmts.commands;

import tmts.Server;

public class Simulatie extends Command
{

    public Simulatie(Server s)
    {
        super(s);
    }

    @Override
    public String getActionString()
    {
        return "simulatie1";
    }

    @Override
    public String execute(String[] command)
    {
        if (command.length == 2)
        {
            Command stopPreviousRace = new Stop(server);
            stopPreviousRace.execute(new String[] { "STOP" });

            Command addSkaterOne = new Add(server);
            addSkaterOne.execute(new String[] { "Add", "KRAMER_10000.1731" });

            Command addSkaterTwo = new Add(server);
            addSkaterTwo.execute(new String[] { "Add", "LEE_10000.1733" });

            Command setSpeed = new SetSpeed(server);
            setSpeed.execute(new String[] { "SetSpeed", "10" });

            Command start = new Start(server);
            start.execute(new String[] { "Start", command[1] });

            return "Simulatie 10000 meter (10 x simulatiesnelheid): KRAMER vs LEE gestart";
        } else
        {
            return "Voer een raceId in: 'simulatie# <raceId>'";
        }
    }

}
